home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / BASIC / 0007.ZIP / FIND-DS.BAS < prev    next >
BASIC Source File  |  1983-11-29  |  640b  |  19 lines

  1. 1 REM this finds the value of BASIC/BASICA'S data segment. useful for determining
  2. 2 REM absolute location of a variable, file buffer, etc.
  3. 3 REM
  4. 4 REM Mark Minasi 5400 Wilson Blvd, Arl. VA 22205 (703) 276-0170
  5. 5 REM
  6. 6 REM as usual, don't use for profit...
  7. 7 REM
  8. 10 DEF SEG
  9. 20 X=0:SUBRT=0:I=0:J=0:A%=0
  10. 30 REM finds the data segment
  11. 40 DIM CODE(40)
  12. 50 SUBRT=VARPTR(CODE(0))
  13. 60 X=(SUBRT+16) MOD 16
  14. 70 SUBRT=SUBRT+16-X
  15. 80 FOR I=0 TO 13:READ J:POKE SUBRT+I,J:NEXT
  16. 90 DATA &h55,&h8c,&hd8,&h89,&he5,&h8b,&h7e,&h06,&h89,&h05,&h5d,&hca,&h02,&h00
  17. 100 CALL SUBRT(A%) 'give back ds
  18. 110 PRINT "data segment=";HEX$(A%)
  19.